#ifndef __IMAGE__H
#define __IMAGE__H

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <tiffio.h>
#include <string.h>
#include <sys/time.h>

#include "gaussian.h"

/* Mean value and maximum deviation acceptable for the Gaussian amplitude */
#define AVERAGE 200
#define DEVIATION 50

#define MICROSECONDSPERSECOND 1000000

/* Writes the image in a .TIFF file (useful for debugging) */
void writeImage (unsigned char* image, char *dest, int weight, int height);

/* Creates a Gaussian image (useful for debugging and testing) */
unsigned char* createImage (int width, int height);

/* Given an image representing a Gaussian shape, it estimates the parameters */
float* createParameters (unsigned char *matrix, int width, int height);

/* Deallocates a Gaussian image (useful for debugging and testing) */
int destroyImage (unsigned char* image);

/* Deallocates the parameters */
int destroyParameters ();

/* Calculates the time difference between time_1 and time_2 (useful for measuring performance) */
long int getCompletionTime (struct timeval* time_1, struct timeval* time_2);

#endif
